9788d15aaf79c929418a66fb64700326814df974,portal-impl/src/com/liferay/portal/security/jaas/ext/jonas/PortalLoginModule.java,PortalLoginModule,commit,#,32

Before Change


		boolean commitValue = super.commit();

		if (commitValue) {
			getSubject().getPrincipals().add(getPrincipal());
			getSubject().getPrivateCredentials().add(getPassword());

			Principal group = (Principal)ReflectionUtil.newInstance(

After Change


		boolean commitValue = super.commit();

		if (commitValue) {
			Subject subject = getSubject();

			Set<Principal> principals = subject.getPrincipals();

			principals.add(getPrincipal());

			Set<Object> privateCredentials = subject.getPrivateCredentials();

			privateCredentials.add(getPassword());

			try {
				Principal group = (Principal)InstanceFactory.newInstance(
					_JGROUP, String.class, "Roles");
				Object role = InstanceFactory.newInstance(
					_JROLE, String.class, "users");

				Method method = MethodCache.get(
					_JGROUP, "addMember", new Class[] {role.getClass()});

				method.invoke(group, new Object[] {role});

				principals.add(group);
			}
			catch (Exception e) {
				_log.error(e, e);